From: Roan Kattouw Date: Thu, 11 Nov 2010 10:15:49 +0000 (+0000) Subject: (bug 25877) Don't focus search box when clicking SimpleSearch's magnifying class... X-Git-Tag: 1.31.0-rc.0~33933 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=f3628a4a2aa93309f83686ce001198856515b83a;p=lhc%2Fweb%2Fwiklou.git (bug 25877) Don't focus search box when clicking SimpleSearch's magnifying class button --- diff --git a/resources/jquery/jquery.placeholder.js b/resources/jquery/jquery.placeholder.js index f445224b34..7390b9e796 100644 --- a/resources/jquery/jquery.placeholder.js +++ b/resources/jquery/jquery.placeholder.js @@ -37,7 +37,14 @@ jQuery.fn.placeholder = function( text ) { // Blank on submit -- prevents submitting with unintended value .parents( 'form' ) .bind( 'submit', function() { - $input.trigger( 'focus' ); + // $input.trigger( 'focus' ); is problematic + // because it actually focuses $input, leading + // to nasty behavior in mobile browsers + if ( $input.hasClass( 'placeholder' ) ) { + $input + .val( '' ) + .removeClass( 'placeholder' ); + } } ); // Show initially, if empty if ( $input.val() == '' ) {